<?php
/**
 * Created by ModelCreater.
 * Date: 2023-09-12
 * Time: 16:40:21
 */
namespace model;

use lib\common\CommonModel;
use lib\utils\CacheUtils;
use think\model\concern\SoftDelete;

class AdminMenuModel extends CommonModel
{
    use SoftDelete;

    protected $table = 'admin_menu';
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = 'datetime';
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';
    protected $hidden = ['delete_time'];


    protected $schema = [
        'id'           => 'int',
        'menu_name'    => 'string',
        'menu_symbol'  => 'string',
        'menu_icon'    => 'string',
        'menu_type'    => 'int',
        'menu_affix'   => 'int',
        'menu_visible' => 'int',
        'menu_cache'   => 'int',
        'api_name'     => 'string',
        'api_path'     => 'string',
        'api_method'   => 'string',
        'list_order'   => 'int',
        'parent_id'    => 'int',
        'create_time'  => 'datetime',
        'update_time'  => 'datetime',
        'delete_time'  => 'datetime',
    ];


    const ALLOWED_FIELDS = ['menu_name', 'menu_symbol', 'menu_icon', 'menu_type', 'menu_affix', 'menu_visible', 'menu_cache', 'api_name', 'api_path', 'api_method', 'list_order', 'parent_id'];
}
